﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IEnumerableExtensions
{
    static class Program
    {
        public static T MyMin<T>(this IEnumerable<T> collection)
            where T : IComparable<T>
        {
            return collection.Min();
        }

        public static T MyMax<T>(this IEnumerable<T> collection)
            where T : IComparable<T>
        {
            return collection.Max();
        }

        public static T MyAgerage<T>(this IEnumerable<T> collection)
            where T : IComparable<T>
        {
            var sortedCollection = collection.OrderBy(x => x).ToList();
            return sortedCollection[sortedCollection.Count() / 2];
        }

        static void Main()
        {
            
        }
    }
}
